//
//  chartTableViewCell.m
//  CMAccountBook
//
//  Created by 王开政 on 2018/11/5.
//  Copyright © 2018年 王开政. All rights reserved.
//

#import "chartTableViewCell.h"

@implementation chartTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        [self addSubview:self.leftImage];
        [self addSubview:self.nameLabel];
        [self addSubview:self.percentLabel];
        [self addSubview:self.moneyLabel];
        [self addSubview:self.schedule];
        
    }
    
    return self;
}
-(UIImageView *)leftImage{
    if (!_leftImage) {
        _leftImage = [[UIImageView alloc]initWithFrame:CGRectMake(20*kfit, 18*kfit, 35*kfit, 35*kfit)];
        
    }
    return _leftImage;
}
-(UILabel *)moneyLabel{
    if (!_moneyLabel) {
        _moneyLabel = [[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth-20*kfit, 15*kfit, 80*kfit, 20*kfit)];
        _moneyLabel.font = [UIFont systemFontOfSize:14*kfit];
        _moneyLabel.textColor = KdarkBlackColor;
        _moneyLabel.textAlignment = NSTextAlignmentRight;
        
    }
    return _moneyLabel;
}
-(UILabel *)nameLabel{
    if (!_nameLabel) {
        _nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(69*kfit, 15*kfit, 40*kfit, 20*kfit)];
        _nameLabel.font = [UIFont systemFontOfSize:14*kfit];
        _nameLabel.textColor = KdarkBlackColor;
//        _nameLabel.textAlignment = NSTextAlignmentRight;
        
    }
    return _nameLabel;
}
-(UILabel *)percentLabel{
    if (!_moneyLabel) {
        _moneyLabel = [[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth-20*kfit, 15*kfit, 80*kfit, 20*kfit)];
        _moneyLabel.font = [UIFont systemFontOfSize:14*kfit];
        _moneyLabel.textColor = KdarkBlackColor;
        _moneyLabel.textAlignment = NSTextAlignmentRight;
        
    }
    return _moneyLabel;
}

-(UIView *)schedule{
    if (!_schedule) {
        _schedule = [[UILabel alloc]initWithFrame:CGRectMake(69*kfit, 49*kfit, 185*kfit, 4*kfit)];

        _schedule.layer.masksToBounds = YES;
        _schedule.layer.cornerRadius = 2*kfit;
        _schedule.backgroundColor = KBGColor;
        
    }
    return _schedule;
}
@end
